A magnetic random access memory (MRAM) is a type of resistance change memories. As techniques for writing data to an MRAM, there have been known magnetic field writing and spin-transfer torque writing. Among these techniques, the spin-transfer torque writing has advantages in higher integration, lower power consumption, and higher performance because of the property of a spin-transfer torque device that a spin injection current is smaller in an amount for magnetization reversal as magnetic bodies become smaller in size.
However, the read current is minute in the spin-transfer torque device. To quickly sense the difference between such minute currents, a stable reference current between the cell current of a memory cell storing data “0” and that of a memory cell storing data “1” is necessary. For example, when a data reading operation is performed, a read current (a cell current) flows from a sense amplifier to a current sink via a selected memory cell. A reference current flows from the sense amplifier to the current sink via a reference cell. The sense amplifier compares the cell current with the reference current and determines the logical state of data stored in the selected memory cell. Therefore, unless the reference current is near between the cell current of a memory cell storing data “0” and that of a memory cell storing data “1”, the sense amplifier may erroneously detect the logical state of the data stored in the selected memory cell.
However, if resistances (that is, currents) of respective reference cells are measured one by one so as to obtain an optimum reference current and to obtain such a reference current, it disadvantageously prolongs the test time, resulting in the increased testing cost of products.